import { postRequest, getRequest, putRequest, deleteRequest } from '/@/lib/axios';

export const permissionsApi = {
  getFetch: (param) => {
    return getRequest('/access/permissions/appsInRole', param);
  },
  add: (param) => {
    return postRequest('/access/permissions/add', param);
  },
  updateVisible: (param) => {
    return getRequest('/access/permissions/updateVisible', param);
  },
  delete: (param) => {
    return getRequest('access/permissions/delete', param);
  },

  // 会话管理
  getSession: (param) => {
    return getRequest('/access/session/fetch', param);
  },
  Overterminate: (ids) => {
    return getRequest('/access/session/terminate?ids=' + ids);
  },


  //角色管理
  getRoles: (param) => {
    return getRequest('/access/roles/fetch', param);
  },
  addRoles: (param) => {
    return postRequest('/access/roles/add', param);
  },
  getRolesinfo: (id) => {
    return getRequest(`/access/roles/get/${id}`);
  },
  updateRoles: (param) => {
    return putRequest('/access/roles/update', param);
  },
  deleteroles: (id) => {
    return deleteRequest('/access/roles/delete?ids=' + id);
  },

};
